<#-- Document Creation Information -->
<SpdxDocument rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
              rdf:about="#SPDXRef-DOCUMENT"
              rdf:about="${documentNamespace}">
    <specVersion>SPDX-2.3</specVersion>
    <dataLicense rdf:resource="http://spdx.org/licenses/CC0-1.0"/>
    <name>${documentName}</name>
    <CreationInfo>
        <creator> Person: ${user}</creator>
        <creator> Organization: ${userGroup}</creator>
        <creator> Tool: sbom-generate-tool-1.0</creator>
    </CreationInfo>
    <CreationInfo>
        <created>${created}</created>
    </CreationInfo>
    <rdfs:comment>
        基于SPDX-2.3生成
    </rdfs:comment>
    <#list packages as package>
    <#-- Package Information -->
        <Package rdf:about="#${package.id}">
            <name>${package.name}</name>
            <versionInfo>${package.version}</versionInfo>
            <packageFileName>${package.fileName}</packageFileName>
            <supplier>NOASSERTION</supplier>
            <originator>NOASSERTION</originator>
            <downloadLocation>${package.downloadLocation}</downloadLocation>
            <filesAnalyzed>false</filesAnalyzed>
            <packageVerificationCode>NONE</packageVerificationCode>
            <checksum>
                <#if package.checksum == "NOASSERTION">
                <Checksum>NOASSERTION</Checksum>
                <#else>
                <Checksum>
                    <algorithm rdf:resource="spdx:checksumAlgorithm_md5"/>
                    <checksumValue>${package.checksum}</checksumValue>
                </Checksum>
                </#if>
            </checksum>
            <homepage>${package.homePage}</homepage>
            <sourceInfo>${package.sourceInfo}</sourceInfo>
            <#if package.licenseConcluded == "NOASSERTION">
            <licenseConcluded>NOASSERTION</licenseConcluded>
            <#else>
            <licenseConcluded rdf:resource="http://spdx.org/licenses/${package.licenseConcluded}"/>
            </#if>
            <licenseInfoFromFiles>NONE</licenseInfoFromFiles>
            <#if package.licenseConcluded == "NOASSERTION">
            <licenseDeclared>NOASSERTION</licenseDeclared>
            <#else>
            <licenseDeclared rdf:resource="http://spdx.org/licenses/${package.licenseConcluded}"/>
            </#if>
            <licenseComments>NONE</licenseComments>
            <copyrightText>NOASSERTION</copyrightText>
            <summary>${package.summary}</summary>
            <description>${package.description}</description>
            <comment>NOASSERTION</comment>
            <externalRef>
                <ExternalRef>
                    <referenceCategory rdf:resource
                                       ="spdx:referenceCategory_packageManager"/>
                    <referenceType rdf:resource
                                   ="https://github.com/package-url/purl-spec"/>
                    <referenceLocator>pkg:${package.externalRef}</referenceLocator>
                </ExternalRef>
                <comment>NOASSERTION</comment>
            </externalRef>
            <attributionText>NOASSERTION</attributionText>
            <primaryPackagePurpose rdf:resource="packagePurpose_library"/>
            <releaseDate>${package.releaseDate}</releaseDate>
            <builtDate>NOASSERTION</builtDate>
            <validUntilDate>NOASSERTION</validUntilDate>
        </Package>
    </#list>
    <#-- Relationship between SPDX Elements Information -->
    <relationship>
        <#list relationships as relationship>
            <Relationship>
                <relatedSpdxElement>
                    <Package rdf:about="#${relationship.id}"/>
                </relatedSpdxElement>
                <relationshipType>http://spdx.org/rdf/terms#relationshipType_dependency_of</relationshipType>
                <relatedSpdxElement>
                    <Package rdf:about="#${relationship.parentId}"/>
                </relatedSpdxElement>
            </Relationship>
        </#list>
    </relationship>
</SpdxDocument>